{% extends "base.html" %}

{% block main %}
	{% for p in posts %}
	<div class='entry'>
		<h2><a href='/p/{{ p.id }}/'>{{ p.subject }}</a></h2>
		<div class='author-date'>
			<span class='author'><a href='/user/{{ p.userid }}/'>{{ post_user.namealias }}</a></span>
			<span class='date'>{{ p.lastmodified_dt|datetimeformat('%Y/%m/%d %H:%M') }}</span>
		</div>
		<div class='content'>{{ p.content }}</div>
		<div class='entry-foot'>
			<span class='{{ 'commentcount' if p.commentcount else 'no_comment' }}'>
				<a href='/p/{{ p.id }}/#comments'>{{ p.commentcount|show_comment_count }}</a></span>
		</div>
	</div>
	<div class='clear'></div>
	
	<div class='comments'><a name='comments'></a>
		<h3>评论</h3>
		{% if comments %}
			<ol class="commentlist">
			{% for c in comments %}
			<li id="comment-{{ c.id }}">
				<div class="commentmetadata">
					<span class='icon'><img src='{{ c.icon }}' width='40' height='40' /></span>
					<span>{{ c.author }}</span>({{ loop.index }}楼)
					-
					{{ c.createdate_dt }}
				</div>
				<div class="commentcontent">{{ c.content }}</div>
			</li>
			{% endfor %}
			</ol>
		{% else %}
			<span class=''>暂无评论。</span>
		{% endif %}
		
		<h3 id="respond">发表评论</h3>
		<form action="/comments/submit/" method="post" id="commentform">
		<p><label for="author">姓名：</label><input name="author" id="author" size="22" tabindex="1" type="text" value=""/> *必填</p>
		<p><label for="email">邮件：</label><input name="email" id="email" size="22" tabindex="2" type="text" value=""/> *必填 (不会被公开)</p>
		<p><label for="url">网站：</label><input name="url" id="url" size="22" tabindex="3" type="text" value=""/>	</p>
		<p><textarea name="comment" id="comment" style="width: 40em;" rows="10" tabindex="4"></textarea></p>
		<p>
			<input name="submit" id="submit" tabindex="5" value="确定发表" type="submit"/>
			<input name="postid" value="{{ p.id }}" type="hidden" />
		</p>
		</form>
	</div>
	{% endfor %}
	
{% endblock %}

{% block sidebar %}
	
{% endblock %}


